<?php
class Zend_Easthv_Xml {

	public static $fullUrl = '';

	public static function setFullUrl($url)
	{
		self::$fullUrl = $url;
	}

	public static function getSitemap($loc,$lastmod = '',$changefreq = '',$priority = '')
	{

		if($lastmod) {

			$lastmod = gmdate(DATE_W3C,strtotime($lastmod));
		
		}

		if($changefreq) {

			$freq = array(
				'always' => true,
				'hourly' => true,
				'daily' => true,
				'weekly' => true,
				'mothly' => true,
				'yearly' => true,
				'never' => true
			);

			$changefreq = isset($freq[$changefreq]) ? $changefreq : 'weekly';
		
		}

		if($priority) {

			$priority = $priority >= 0 && $priority <= 1 ? $priority : 0.5;
		
		}

		return array(
			'loc' => self::$fullUrl . $loc,
			'lastmod' => $lastmod,
			'changefreq' => $changefreq,
			'priority' => $priority	
		);
	
	}


}
?>
